package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 配送员表
 */
@ApiModel(description = "配送员表")
@Entity
@Table(name = "couriers")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Couriers implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 配送员编码
     */
    @ApiModelProperty(value = "配送员编码")
    @Column(name = "courier_code")
    private String courierCode;

    /**
     * 配送员姓名
     */
    @ApiModelProperty(value = "配送员姓名")
    @Column(name = "name")
    private String name;

    /**
     * 配送员性别
     */
    @ApiModelProperty(value = "配送员性别")
    @Column(name = "sex")
    private String sex;

    /**
     * 配送员年龄
     */
    @ApiModelProperty(value = "配送员年龄")
    @Column(name = "age")
    private String age;

    /**
     * 配送员电话
     */
    @ApiModelProperty(value = "配送员电话")
    @Column(name = "phone")
    private String phone;

    /**
     * 配送员可用状态
     */
    @ApiModelProperty(value = "配送员可用状态")
    @Column(name = "available_status")
    private Boolean availableStatus;

    /**
     * 配送员在线状态
     */
    @ApiModelProperty(value = "配送员在线状态")
    @Column(name = "on_line_status")
    private Boolean onLineStatus;

    /**
     * 总接单数
     */
    @ApiModelProperty(value = "总接单数")
    @Column(name = "total_orders")
    private Integer totalOrders;

    /**
     * 评分
     */
    @ApiModelProperty(value = "评分")
    @Column(name = "score", precision = 21, scale = 2)
    private BigDecimal score;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCourierCode() {
        return courierCode;
    }

    public Couriers courierCode(String courierCode) {
        this.courierCode = courierCode;
        return this;
    }

    public void setCourierCode(String courierCode) {
        this.courierCode = courierCode;
    }

    public String getName() {
        return name;
    }

    public Couriers name(String name) {
        this.name = name;
        return this;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public Couriers sex(String sex) {
        this.sex = sex;
        return this;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAge() {
        return age;
    }

    public Couriers age(String age) {
        this.age = age;
        return this;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getPhone() {
        return phone;
    }

    public Couriers phone(String phone) {
        this.phone = phone;
        return this;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Boolean isAvailableStatus() {
        return availableStatus;
    }

    public Couriers availableStatus(Boolean availableStatus) {
        this.availableStatus = availableStatus;
        return this;
    }

    public void setAvailableStatus(Boolean availableStatus) {
        this.availableStatus = availableStatus;
    }

    public Boolean isOnLineStatus() {
        return onLineStatus;
    }

    public Couriers onLineStatus(Boolean onLineStatus) {
        this.onLineStatus = onLineStatus;
        return this;
    }

    public void setOnLineStatus(Boolean onLineStatus) {
        this.onLineStatus = onLineStatus;
    }

    public Integer getTotalOrders() {
        return totalOrders;
    }

    public Couriers totalOrders(Integer totalOrders) {
        this.totalOrders = totalOrders;
        return this;
    }

    public void setTotalOrders(Integer totalOrders) {
        this.totalOrders = totalOrders;
    }

    public BigDecimal getScore() {
        return score;
    }

    public Couriers score(BigDecimal score) {
        this.score = score;
        return this;
    }

    public void setScore(BigDecimal score) {
        this.score = score;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Couriers)) {
            return false;
        }
        return id != null && id.equals(((Couriers) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "Couriers{" +
            "id=" + getId() +
            ", courierCode='" + getCourierCode() + "'" +
            ", name='" + getName() + "'" +
            ", sex='" + getSex() + "'" +
            ", age='" + getAge() + "'" +
            ", phone='" + getPhone() + "'" +
            ", availableStatus='" + isAvailableStatus() + "'" +
            ", onLineStatus='" + isOnLineStatus() + "'" +
            ", totalOrders=" + getTotalOrders() +
            ", score=" + getScore() +
            "}";
    }
}
